package com.zyh.abstract1;

import com.zyh.domain.MyArrayUtilImpl;

import java.util.Arrays;

public class TestMyArrayUtilImpl {
    public static void main(String[] args) {
        MyArrayUtilImpl myArrayUtil = new MyArrayUtilImpl();
        int[] arr={3,6,7,99,123,432,545,567,999};
        //查找数组所有元素
        myArrayUtil.findAll(arr);
        //二分查找指定元素
        myArrayUtil.findIndex(arr,999);
        //反转数组
        int[] fanZhuanShuZu = myArrayUtil.fanZhuanShuZu(arr);
        System.out.println(Arrays.toString(fanZhuanShuZu));
        //删除数组指定索引的元素
        int[] deleteArray = myArrayUtil.deleteArray(arr, 2);
        System.out.println(Arrays.toString(deleteArray));
        //数组指定索引添加元素
        int[] addArray = myArrayUtil.addArray(arr, 1, 5);
        System.out.println(Arrays.toString(addArray));
    }
}
